<@c.html>
    <div class="card">
        <div class="card-body no-padding">
            <div class="panel panel-default no-margin">
                <div class="panel-heading">查询条件</div>
                <div class="panel-body">
                    <form class="form-inline" id="query-from">
                        <div class="form-group">
                            <label for="userName">input</label>
                            <input type="email" class="form-control" name="userName" id="userName" placeholder="Enter email">
                        </div>
                        <div class="form-group float-right">
                            <button type="button" class="btn btn-default" id="search">search</button>
                            <button type="reset" class="btn btn-default">reset</button>
                        </div>
                    </form>
                </div>
            </div>
            <table id="table"></table>
            <div id="toolbar">
                <button class="btn-success">新增</button>
                <button class="btn-success">更新</button>
                <button class="btn-success">删除</button>
                <button class="btn-success">查看</button>
                <button class="btn-success">导入</button>
                <button class="btn-success">导出</button>
            </div>
        </div>
    </div>
</@c.html>
<script type="text/javascript">
    $(function(){
        $('#table').bootstrapTable({
            url: 'search',
            columns: [{
                field: 'id',
                title: 'id'
            }, {
                field: 'userName',
                title: 'userName'
            }, {
                field: 'password',
                title: 'password'
            }],
            pagination: true,
            sidePagination: 'server',
            toolbar: "#toolbar",
            showToggle : true
        });
    });
    $("#search").click(function(){
        var params = {};
        $.each($("#query-from").serializeArray(), function(i, data) {
            params[data.name] = data.value;
        });
        $('#table').bootstrapTable('refresh', {query : params});
    });
</script>
